<template>
  <div class="bg-white page">
    <img src="../../../public/icons/folder@2x.png" alt="">
    <div class="label" >老师点评文书</div>
    <!-- <a
      :href="`http://essay.shenqingquan.com/prod-api/aifront/task/myattach?taskId=${taskId}&sign=${sign}`"
    > -->
    <a
      :href="downloadUrl"
    >
      <van-button class="btn btn-download" color="#0B3E98">下载文书</van-button>
    </a>
    <div class="warning">提醒：iphone手机，建议在电脑浏览器上下载文书</div>
  </div>
</template>

<script>
import $api from '../../api/systemApi'
export default {
  data() {
    return {
      taskId: '',
      sign: '',
      downloadUrl: '#'
    }
  },
  methods: {
    getUrl() {
      let { taskId, sign } = this
      $api.downloadFile({ taskId, sign }).then(res => {
        if (res.code == 200) {
          this.downloadUrl = res.data
        } else {
          this.$toast(res.msg)
        }
      })
    }
  },
  created() {
    this.taskId = this.$route.query.taskId
    this.sign = this.$route.query.sign
    this.getUrl();
  }
}
</script>

<style scoped>
.warning {
  margin-top: 30px;
  height: 33px;
  font-size: 24px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #999999;
  line-height: 33px;
}
.page {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}
.label {
  width: 168px;
  height: 40px;
  font-size: 28px;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #333333;
  line-height: 40px;
  margin: 20px auto 100px;
}
.bg-white {
  background-color: white;
}
img {
  margin-top: 100px;
  width: 180px;
  height: 180px;
}
</style>
